<template> 	
  <div class="page">
	<div class="layui-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12">
					<div class="layui-card">
						<!--<div class="layui-card-header">编辑</div>-->
						<div class="layui-card-body">		
					    <table class="layui-table">
					      
					      <thead>
					        <tr>
					          <th>货品名称</th>
					          <th>货品图片</th>
					          <th>规格</th>
					          <th>价格</th>
					          <th>数量</th>
					          <th>商家账号</th>
					          <th>门店名称</th>
					          <th>重量</th>
					          <th>时间</th>
					        </tr> 
					      </thead>
					      <tbody>
					        <tr v-for="item in itemData">
					          <td>{{item.commodityName}}</td>
					          <td><img :src="itemData.commodityLogo?itemData.commodityLogo:require('@/assets/zwyl.jpg')" width="50"/></td>
					          <td>{{item.goodsName}}</td>
					          <td>{{item.price}}</td>
					          <td>{{item.amount}}</td>
					          <td>{{item.dealerName}}</td>
					          <td>{{item.shopName}}</td>
					          <td>{{item.weight}}</td>
					          <td>{{dotime(item.createAt)}}</td>
					        </tr>
					        
					      </tbody>
					    </table>
							
							
							
							
						</div>
					</div>
				</div>
			</div>
		</div>
		<input type="hidden" id='id'/>
  </div> 
</template>
<script>

export default {	
  name: 'shopgoods',  
  data () {
    return { 
    	id:'',
    	curindex:1, //页数    	    	    	
    	itemData:{}, 
    	createAt:'',
    }
  },
  mounted(){ 
  	var _this = this;
	  window.getdates = this.getdates;  
  },
  methods: {  	
		getdates:function(id){		
			var _this = this; 
			_this.id=id;
//			_this.id=$("#id").val();
			var url="/order/itemsJson"
			var dates={
				id:_this.id,				
			}
			ajaxRequest(url,'GET','json',dates,function(ret,err){
			//	alert(JSON.stringify(ret))
				  _this.itemData=ret.content; 
				 // _this.createAt=FormatDate(ret.content[0].createAt)
				 
			})			
		},		
  	dotime(val){
  		return FormatDate(val);
  	}
  },
   updated:function(){
		this.isShow = true;
		var _this=this;
		layui.use('form', function(){
		  var form = layui.form;
		  form.render();
		  form.on("select(status)", function(data){										
			   _this.status = data.value
		  });
		});
  },

}
</script>
<style scoped>
</style>
